package com.rjj.breakfor;

/**
 * @author renjianjun
 * @date 2020/9/20 08:25
 * @email 215060580@qq.com
 *
 * 循环的跳出循环
 */
public class forXh {

    public static void main(String[] args) {

        //breakOne();

        //break2();
        int maxColumnWidth = '\uff00';

        System.out.println(maxColumnWidth);
    }

    /**
     * break跳出循环，只会跳出一次
     */
    private static void breakOne() {
        for (int i = 0; i <10; i++) {
            System.out.println("i:"+i);
            for (int j = 0; j < 10; j++) {
                System.out.println("j:"+j);
                if(j == 1){
                    break;
                }
            }
        }
    }

    /**
     * 跳出循环到指定的层
     */
    private static void break2() {
       two: for (int i = 0; i <10; i++) {
            System.out.println("i:"+i);
            for (int j = 0; j < 10; j++) {
                System.out.println("j:"+j);
                if(j == 1){
                    break two;
                }
            }
        }
    }
}
